#include <bits/stdc++.h>
using namespace std;
using ll = long long;
using pii = pair<int, int>;
#define rep(i, a, b) for (int i = (a); i <= (b); i++)
#define per(i, a, b) for (int i = (a); i >= (b); i--)
#define endl '\n'
const int N = 505;
const int MX = 499;
int p;
int a[N], b[N];
void mul(int a[N], int b[N], int c[N]) {
  int t[N] = {0};
  rep(i, 0, MX) rep(j, 0, MX - i) { t[i + j] += a[i] * b[j]; }
  rep(i, 0, MX) t[i + 1] += t[i] / 10, t[i] %= 10;
  rep(i, 0, MX) c[i] = t[i];
}
void fastpow(int b[N], int p, int res[N]) {
  while (p) {
    if (p & 1) mul(res, b, res);
    mul(b, b, b);
    p >>= 1;
  }
}
int main() {
  ios::sync_with_stdio(0), cin.tie(0), cout.tie(0);
  cin >> p;
  int len = p * log10(2) + 1;
  cout << len << endl;
  b[0] = 2;
  a[0] = 1;
  fastpow(b, p, a);
  a[0]--;
  per(i, MX, 0) {
    cout << a[i];
    if (i % 50 == 0) cout << endl;
  }
  return 0;
}